package com.lyd.sweet.web.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 响应结果封装处理程序配置，可配置响应结果是否统一包装
 * 配置文件配置此属性的微服务，没有在特例注解API,即根据配置选择是否包装，默认true包装
 * 配置示例
 * sweet:
 *   handler:
 *     result-handler-enabled: false
 *     show-request-detail-when-err: true
 *
 * @author 木木
 */
@ConfigurationProperties(prefix = "sweet.handler")
public class SweetHandlerProperties {
    /**
     * 是否开启返回包装
     */
    private boolean resultHandlerEnabled = true;

    /**
     * 异常时日志是否显示详细请求信息
     */
    private Boolean showRequestDetailWhenErr = true;

    public boolean isResultHandlerEnabled() {
        return resultHandlerEnabled;
    }

    public void setResultHandlerEnabled(boolean resultHandlerEnabled) {
        this.resultHandlerEnabled = resultHandlerEnabled;
    }

    public Boolean getShowRequestDetailWhenErr() {
        return showRequestDetailWhenErr;
    }

    public void setShowRequestDetailWhenErr(Boolean showRequestDetailWhenErr) {
        this.showRequestDetailWhenErr = showRequestDetailWhenErr;
    }
}
